import Page from './page'
import { kWinHints } from './api'

const Login = Page.extend(function () {
  var self = this

  var initPage = function () {
    self.hide()
    self.removeStyle(kWinHints.kTopMostHint)
    self.addStyle(kWinHints.kInTaskbarHint) // 显示状态栏图标
    self.resize(340, 510)
    // self.setMinSize(340, 510)
    self.align(4)
    self.setNCBorderWidth(0)
    self.setCaptionArea([[0, 0, 300, 30]])

    if (typeof window !== 'undefined') {
      window.oncontextmenu = function (event) {
        event.returnValue = false
      }
    }
    window.ondragstart = function (event) {
      return false
    }

    console.info('+++++++++++++++++', self.machineUuid())
  }

  this.init = function () {
    this.super.init()
    initPage()
  }

  this.start = function (vue) {
    this.super.start(vue)
    self.show()
  }
})

var _Login = null

Login.impl = function () {
  return _Login || (_Login = new Login())
}

export default Login
